package com.wh.wisdomsite.xbox.st.service;

import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.wh.wisdomsite.xbox.common.reponse.CommonResult;
import com.wh.wisdomsite.xbox.pojo.st.PurchaseDetailIn;
import com.wh.wisdomsite.xbox.st.entity.PurchaseApply;
import com.wh.wisdomsite.xbox.st.entity.PurchaseDetail;
import com.wh.wisdomsite.xbox.us.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author 刘旭
 * @version V1.0
 * @Package com.wh.wisdomsite.xbox.st.service
 * @date 2019年01月02日 16:55
 * @Copyright 企业版权所有
 * @Company 贵州万华科技有限公司Copyright (c) 2018
 */
public interface IPurchaseDetailService extends IService<PurchaseDetail> {
    /**
     * 获取申请已经上报分页列表
     * @param var1
     * @param var2
     * @return
     */
    Page<Map<String, Object>> getContrastPage(Page var1, Wrapper<PurchaseDetail> var2);

    /**
     * 更新或添加请购详情
     * @param purchaseApply
     * @param detailList
     * @param curUser
     * @return
     */
    CommonResult saveOrUpdate(PurchaseApply purchaseApply, List<PurchaseDetail> detailList, User curUser);
    /**
      * 确认收货
     * @param purchaseDetailInList
     * @return
     */
    void saveConfirm(List<PurchaseDetailIn> purchaseDetailInList,String userId) throws Exception;


    /**
     * 根据条件获取采购清单
     * @param ew
     * @return
     */
    List<PurchaseDetail> getPurchaseDetails(@Param("ew") Wrapper<PurchaseDetail> ew);

    /**
     * 根据条件获取采购清单，map型，直接附带物料信息
     * @param ew
     * @return
     */
    List<Map<String, Object>> getPurchaseDetailMaps(Wrapper<PurchaseDetail> ew);
}
